/*
 * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

#import <Foundation/Foundation.h>


#define S3_BUCKET_VERSIONING_OFF          @"Off"
#define S3_BUCKET_VERSIONING_SUSPENDED    @"Suspended"
#define S3_BUCKET_VERSIONING_ENABLED      @"Enabled"



/**
 * Represents the versioning configuration for a bucket.
 * A bucket's versioning configuration can be in one of three possible states:
 * Off, Enabled, Suspended
 *
 * By default, new buckets are in the off state. Once versioning is
 * enabled for a bucket the status can never be reverted to Off.
 *
 * In addition to enabling versioning, a bucket's versioning configuration can
 * also enable Multi-Factor Authentication (MFA) Delete, which restricts the
 * ability to permanently delete a version of an object. When MFA Delete is
 * enabled, only requests from the bucket owner which include an MFA token
 * generated by the hardware authentication device associated with the bucket
 * owner's AWS account can permanently delete an object version. For more
 * information on AWS Multi-Factor Authentication see <a
 * href="http://aws.amazon.com/mfa/">http://aws.amazon.com/mfa/</a>
 *
 * The versioning configuration of a bucket has different implications for each
 * operation performed on that bucket or for objects within that bucket. For
 * instance, when versioning is enabled, a PutObject operation creates a unique
 * object version-id for the object being uploaded. The PutObject API guarantees
 * that, if versioning is enabled for a bucket at the time of the request, the
 * new object can only be permanently deleted using the DeleteVersion operation.
 * It can never be overwritten. Additionally, PutObject guarantees that, if
 * versioning is enabled for a bucket the request, no other object will be
 * overwritten by that request. Refer to the documentation sections for each API
 * for information on how versioning status affects the semantics of that
 * particular API.
 */
@interface S3BucketVersioningConfiguration:NSObject {
    NSString *status;
    bool     isMfaDeleteEnabled;
}

/** The current status of versioning */
@property (nonatomic, retain) NSString *status;


/**
 * Indicates if the optional Multi-Factor Authentication Delete control is
 * enabled for this bucket versioning configuration.
 */
@property (nonatomic) bool isMfaDeleteEnabled;


/** Initialize the object with a status */
-(id)initWithStatus:(NSString *)status;


-(NSString *)toXml;

@end
